Skip to content

fix(desktop): restore custom icon when macOS Dock returns - #12336

Open
amanayayatu-tech wants to merge 2 commits into
makecindy:mainfrom
amanayayatu-tech:cindy/tender-babbage
Open

amanayayatu-tech wants to merge 2 commits into
makecindy:mainfrom
amanayayatu-tech:cindy/tender-babbage

Conversation

@amanayayatu-tech

Copy link
Copy Markdown
Contributor

这次改了什么

摘要

macOS Dock 在辅助窗口的进程类型转换后会重建磁贴。重建时可能显示安装包默认图标,此时 Cindy 内存里仍记着已经应用过的自定义资源路径。等现有 Dock 恢复流程完成后,清除这条缓存,用当前图标偏好和主题重新应用图标。

变更类型

  • fix 缺陷修复

范围

UI 变化

  • 引用的设计规范:不涉及。变更位于主进程的 Dock 恢复分支,沿用既有图标资源、设置界面和主题规则。

怎么验证的

自动验证

  • pnpm --filter desktop run --if-present typecheck 通过。
  • pnpm --dir apps/desktop exec vitest run --maxWorkers=1 src/main/computer-permission-guide/__tests__/electron-window.test.ts src/main/remote-desktop/__tests__/privacyScreen.test.ts 通过,2 个文件共 71 项。
  • git diff --check 通过。

手工验证

macOS 27.2.1 arm64,Electron 42.11.12。使用独立 bundle ID 和测试资料目录,通过 Cindy 的 updateAppearanceFromSettings 设置图标,以同样的 Electron 全屏辅助窗转换产生真实 Dock 隐藏,关闭测试窗后走 scheduleMainAppPresenceRestore。从 macOS Dock 窗口截图取测试磁贴像素,并记录 PID、appIcon 和主题。辅助窗保持隐藏。

场景 结果
修前,两次 Dock 隐藏再显示 PID 41665 和 cat 保持不变,恢复后的磁贴像素两次均与安装包图标一致
修后,同样两次转换 PID 44518 和 cat 保持不变,恢复后的磁贴像素两次均与隐藏前黑猫一致
无辅助窗,以及跳过进程转换的辅助窗 Dock 始终可见,黑猫保持
主动选择默认 默认图标当即显示,下次 Dock 重建仍显示默认图标
自动主题 同一进程中用 mark 对照浅色和跟随系统(深色)。两种主题显示不同资源,各自经 Dock 重建后像素一致

仅在实际重显示分支多一次现有外观设置快照读取和一次自定义 PNG 应用,正常已可见路径为 0 次。整个恢复流程新增远程请求、IPC、持久化写或轮询均为 0。

F=10/10(受控转换修前 2/2 复现,用户日常遇到该转换的频率未知),S=2/10(图标显示错误,保存的用户偏好和当前进程仍正常)。

未执行的验证

没有运行完整远控会话或在第二台 Mac 上复测。测试使用实际 Dock 与生产恢复入口,辅助窗测试只复用生产 Electron 转换参数。

风险

  • 跨平台差异

影响与回滚

  • 影响范围为 macOS 主进程已进入 Dock 重显示分支的情况。若回滚,撤销本提交即可。

提交前检查

  • 已 review 完整 diff
  • 每个 commit 都带 DCO 签名
  • 已核对受影响的文档和 Mac 实测结果

Signed-off-by: Nepha Peachy <267095040+amanayayatu-tech@users.noreply.github.com>
@amanayayatu-tech
amanayayatu-tech requested a review from a team as a code owner November 23, 2026 18:09
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T18:16:19.850265Z 87c443e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] 本次改动范围明确,未发现阻止合并的问题。

Summary

本次修改在 macOS Dock 重新显示后清除已应用图标的路径缓存,再按当前偏好和主题恢复自定义图标。

  • Restored macOS Dock tiles show the icon chosen in appearance settings.

Reviews (1) · Last reviewed commit: "fix(desktop): restore custom icon when m..." · Reviewed by Greptile

Signed-off-by: Nepha Peachy <267095040+amanayayatu-tech@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

macOS 上设置自定义 App 图标后,程序坞图标在使用中会自行恢复为默认图标

1 participant